class Photo < ActiveRecord::Base
  has_one :store_product, :as => :resource
  
  def self.create(params, store_id, print_category_id, print_product_id)
    photo = Photo.new(:size => params[:size])
    store_product = StoreProduct.create_store_product(params, store_id, print_category_id, print_product_id)
    store_product.resource = photo
    store_product.save!
    store_product
  end
end
